<!--根据这个页单独设置样式-->
<style>
    .table-responsive{overflow-x: inherit}
    td{ vertical-align: middle!important;}
    .pagination{ margin:0!important;}
    .flot{float: left}
    .rlot{float: right}
</style>
<script type="text/ng-template" id="addTags.html">
    <div class="modal-header">
        <h3 class="modal-title">添加标签</h3>
    </div>
    <div class="modal-body">
        <div class="row" style="padding: 1% 0">
            <div class=" " style="padding-bottom: 10px;width: 100%">
                <div class="col-sm-2 text-right" style="padding-top: 5px;">名称：</div>
                <div class="col-sm-8">
                    <input class="form-control" ng-model="vm.name" type="text" placeholder="请在这里输入名称">
                </div>
            </div>
        </div>
        <div class="row" style="padding: 1% 0">
            <div style="padding-bottom: 10px;width: 100%">
                <div class="col-sm-2 text-right" style="padding-top: 5px;">状态：</div>
                <div class="col-sm-8">
                    <label class="i-switch m-t-xs m-r">
                        <input type="checkbox"
                               ng-true-value="'1'"
                               ng-false-value="'0'"
                               ng-model="vm.status" >
                        <i></i>
                    </label>
                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button class="btn btn-sm btn-danger" ng-click="cancel()">Cancel</button>
        <button class="btn btn-sm btn-success" ng-click="ok()">OK</button>
    </div>
</script>
<script type="text/ng-template" id="upTags.html">
    <div class="modal-header">
        <h3 class="modal-title">修改标签</h3>
    </div>
    <div class="modal-body">
        <div class="row" style="padding: 1% 0">
            <div style="padding-bottom: 10px;width: 100%">
                <div class="col-sm-2 text-right" style="padding-top: 5px;">名称：</div>
                <div class="col-sm-8">
                    <input class="form-control" ng-model="vm.name" type="text" placeholder="请在这里输入名称">
                </div>
            </div>
        </div>
        <div class="row" style="padding: 1% 0">
            <div style="padding-bottom: 10px;width: 100%">
                <div class="col-sm-2 text-right" style="padding-top: 5px;">状态：</div>
                <div class="col-sm-8">
                    <label class="i-switch m-t-xs m-r">
                        <input type="checkbox"
                               ng-true-value="'1'"
                               ng-false-value="'0'"
                               ng-model="vm.status" >
                        <i></i>
                    </label>
                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button class="btn btn-sm btn-danger" ng-click="cancel()">Cancel</button>
        <button class="btn btn-sm btn-success" ng-click="ok()">OK</button>
    </div>
</script>
<div>
    <div class="bg-light lter b-b wrapper-md">
        <h1 class="m-n font-thin h3">标签
            <button class="btn btn-sm pull-right btn-success" ng-click="model.open()">添加</button>
        </h1>
    </div>
    <div class="padder-md m-b-none m-t" style="padding-top: 0">
        <div class="panel panel-default">
            <div class="panel-heading">标签列表</div>
            <div class="m-sm">
                <div class="clearfix">
                    <h5>搜索筛选项：</h5>
                    <div class="row wrapper" style="padding-bottom:0;">
                        <div class="col-sm-3 col-md-2 col-lg-2">
                            <input class="form-control ng-pristine ng-untouched ng-valid"
                                   ng-model="ctrl.vm.search.id" type="text" placeholder="标签id" >
                        </div>
                        <div class="col-sm-3 col-md-2 col-lg-2">
                            <input class="form-control ng-pristine ng-untouched ng-valid"
                                   ng-model="ctrl.vm.search.name" type="text" placeholder="标签名称" >
                        </div>
                        <div class="col-sm-3 col-md-2 col-lg-2">
                            <select class="form-control" ng-model="ctrl.vm.search.status">
                                <option value="">状态</option>
                                <option value="0">禁用</option>
                                <option value="1">启用</option>
                            </select>
                        </div>
                        <div class="col-sm-3 col-md-2 col-lg-2">
                            <div>
                                <button class="btn btn-sm btn-default" type="button" ng-click="ctrl.vm.searchFn()">搜索</button>
                                <button class="btn btn-sm btn-dark" type="button" ng-click="ctrl.vm.reset()">重置</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="table-responsive">
                <table class="table table-striped b-t b-light">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>名称</th>
                        <th>状态</th>
                        <th>创建时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="data in ctrl.vm.data">
                        <td>{{data.id}}</td>

                        <td>
                            {{data.name}}
                        </td>
                        <td>
                            <span class="label bg-success" ng-if="data.status==1">启用</span>
                            <span class="label bg-danger" ng-if="data.status==0">禁用</span>
                        </td>
                        <td>
                            {{data.created_at}}
                        </td>
                        <td>
                            <button class="btn btn-sm btn-primary" ng-click="model.open1(data)">编辑</button>
                            <!--<button class="btn btn-sm btn-danger" ng-click="model.del(data)">删除</button>-->
                        </td>
                    </tr>
                    <tr ng-if="!ctrl.vm.data.length">
                        <td colspan="12" class="text-center">暂无数据！</td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <footer class="panel-footer">
                <div class="row">
                    <div class="col-sm-2 hidden-xs">
                        <select
                                class="input-sm form-control w-sm inline v-middle"
                                ng-model="placement.selected"
                                ng-options="o as o for o in placement.options"
                                ng-change="placement.changeFn()"
                        >
                        </select>
                        <i style="float: right;padding: 2% 15% 0 0">总计{{vm.page.total}}</i>
                    </div>
                    <div class="col-sm-10 text-right text-center-xs">
                        <div class="pagination pagination-sm m-t-none m-b-none">
                            <uib-pagination
                                    boundary-links="true"
                                    total-items="vm.page.total"
                                    max-size="placement.pageSize"
                                    items-per-page="placement.selected"
                                    ng-model="vm.page.current_page"
                                    ng-change="pageChanged()"
                                    class="pagination-sm"
                                    previous-text="&lsaquo;"
                                    next-text="&rsaquo;"
                                    first-text="&laquo;"
                                    last-text="&raquo;"
                            >
                            </uib-pagination>
                        </div>
                    </div>
                </div>
            </footer>
        </div>
    </div>
</div>